package cn.juforg.gobang;
/**
 * 
 * @author Juforg
 * 棋子类
 */
public class Chess {

	private int x ;
	private int y ;
	
	public Chess(int x, int y) {
		super();
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	@Override
	public int hashCode() {
		return x + y ;
	}

	@Override
	public boolean equals(Object obj) {
		if(this==obj){
			return true;
		}
		Chess otherchess = (Chess) obj;
		if(x != otherchess.x)
			return false;
		if(y != otherchess.y)
			return false;
		return true;
	}

	@Override
	public String toString() {
		String s = "["+x+"]["+y+"]";
		return s;
	}
	
	
	
}
